import axios from 'axios'
import qs from 'qs'
const service = axios.create({
  baseURL: 'https://uri.amap.com', // api 的 base_url
  timeout: 5000 // 请求超时时间
})
export const  searPol =(adecode,search)=>{
  debugger
    var parameters={

      city:adecode,
      keywords:search
    }
  return new Promise((resolve, reject) => {
    debugger
    var url="/search";
    if (parameters) {
      url = url + '?' + qs.stringify(parameters)
    }
    service.get(url).then(res => {
      alert(JSON.stringify(res))
      resolve(res)
    }).catch(error => {
      reject(error)
    })
  })
}
